package client;

import client.gui.ClientGUI;
import client.gui.SettingsGUI;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;

public class TestingClient {

    public boolean autoConnect = false;
    public int serverPort = 32001;
    public String name = "Moo";
    public String destination = "192.168.1.1";

    public ObjectOutputStream out;
    public ObjectInputStream in;
    public Socket clientSocket;
    public PacketHandler packetHandler;
    public ClientGUI clientGUI;
    public ReceivePacketThread receive;
    public ConnectionThread connect;
    public boolean isConnected = false;

    public static void main(String[] args) {
        new TestingClient();
    }

    public TestingClient() {
        clientGUI = new ClientGUI(this);
        clientGUI.setVisible(true);
        clientGUI.setInputFieldEnabled(false); 
        clientGUI.addLine("TestingClient started.");
        new SettingsGUI(this).setVisible(true);
        packetHandler = new PacketHandler(this);
    }

    public void run() {
        connect = new ConnectionThread(this, serverPort, name, destination, autoConnect);
        connect.start();
    }
}
